﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;
using Autodesk.AutoCAD.DatabaseServices;
using System.Windows.Forms;
using DNA;

namespace TJADRICD.CollaborativeDesignPlugin
{
    public class NameDate
    {
        public string Name;
        public string Date;
        public NameDate()
        {
            Name = "";
            Date = "";
        }
    }

    public class FrameInfo
    {
        public FrameInfo()
        {
            versionList = new VersionList();
        }

        // 图框类型
        public FrameVersionType Type { get; set; }

        // 日期
        public string Date { get; set; }
        //版次			
        public string Rev { get; set; }
        //版次说明-中
        public string DescriptionChinese { get; set; }
        //版次说明-英		
        public string DescriptionEnglish { get; set; }
        //建设单位-中		
        public string ClientChinese { get; set; }
        //建设单位-英		
        public string ClientEnglish { get; set; }
        //项目名称-中		
        public string ProjectNameChinese { get; set; }
        //项目名称-英		
        public string ProjectNameEnglish { get; set; }
        //子项名称-中		
        public string SubProjectChinese { get; set; }
        //子项名称-英		
        public string SubProjectEnglish { get; set; }
        //项目编号		
        public string ProjectNo { get; set; }
        //子项编号		
        public string SubProjectNo { get; set; }
        //图纸名称-中		
        public string SheetTitleChinese { get; set; }
        //图纸名称-英		
        public string SheetTitleEnglish { get; set; }
        //专业-中			
        public string DisciplineChinese { get; set; }
        //专业-英			
        public string DisciplineEnglish { get; set; }
        //阶段-中			
        public string StageChinese { get; set; }
        //阶段-英			
        public string StageEnglish { get; set; }
        //图号			
        public string SheetNo { get; set; }
        //版次2			
        public string Rev2 { get; set; }

        public string strCTB { get; set; }

        public string frameType {get; set;}

        public int scale {get; set;}

        public VersionList versionList;


        //审定
        public NameDate ApprovedBy = new NameDate();
        //审核			
        public NameDate ReviewedBy = new NameDate();
        //校对
        public NameDate CheckedBy = new NameDate();
        //设计总负责人1	
        public NameDate PrincipalInCharge1 = new NameDate();
        //设计总负责人2	
        public NameDate PrincipalInCharge2 = new NameDate();
        //专业负责人1
        public NameDate DisciplineResponsible1 = new NameDate();
        //专业负责人2		
        public NameDate DisciplineResponsible2 = new NameDate();
        //设计1			
        public NameDate DesignedBy1 = new NameDate();
        //设计2			
        public NameDate DesignedBy2 = new NameDate();
        //绘图			
        public NameDate DrawnBy = new NameDate();

        //会签
        //建筑1		
        public NameDate Architecture1 = new NameDate();
        //建筑2			
        public NameDate Architecture2 = new NameDate();
        //建筑3			
        public NameDate Architecture3 = new NameDate();

        //给排水1		
        public NameDate Plumbing1 = new NameDate();
        //给排水2			
        public NameDate Plumbing2 = new NameDate();
        //给排水3			
        public NameDate Plumbing3 = new NameDate();

        //暖通1		
        public NameDate HVAC1 = new NameDate();
        //暖通2			
        public NameDate HVAC2 = new NameDate();
        //暖通3			
        public NameDate HVAC3 = new NameDate();

        //强电1		
        public NameDate Electricity1 = new NameDate();
        //强电2			
        public NameDate Electricity2 = new NameDate();
        //强电3			
        public NameDate Electricity3 = new NameDate();

        //结构1		
        public NameDate Structure1 = new NameDate();
        //结构2			
        public NameDate Structure2 = new NameDate();
        //结构3			
        public NameDate Structure3 = new NameDate();
        //结构4		
        public NameDate Structure4 = new NameDate();
        //结构5			
        public NameDate Structure5 = new NameDate();
        //结构6			
        public NameDate Structure6 = new NameDate();
        //结构7		
        public NameDate Structure7 = new NameDate();

        //动力1		
        public NameDate Power1 = new NameDate();
        //动力2			
        public NameDate Power2 = new NameDate();
        //动力3			
        public NameDate Power3 = new NameDate();

        //弱电1		
        public NameDate ELV1 = new NameDate();
        //弱电2			
        public NameDate ELV2 = new NameDate();
        //弱电3			
        public NameDate ELV3 = new NameDate();

        //从属性数组里读出信息赋给对象自身
        public void LoadFromAttrRefs(List<AttributeReference> attrRefs)
        {
            versionList.LoadFromAttribute(attrRefs);
            foreach (AttributeReference attrRef in attrRefs)
            {
                switch (attrRef.Tag)
                {
                    case "ClientChinese":
                        ClientChinese = attrRef.TextString;
                        break;
                    case "ClientEnglish":
                        ClientEnglish = attrRef.TextString;
                        break;
                    case "ProjectNameChinese":
                        ProjectNameChinese = attrRef.TextString;
                        break;
                    case "ProjectNameEnglish":
                        ProjectNameEnglish = attrRef.TextString;
                        break;
                    case "SubProjectChinese":
                        SubProjectChinese = attrRef.TextString;
                        break;
                    case "SubProjectEnglish":
                        SubProjectEnglish = attrRef.TextString;
                        break;
                    case "ProjectNo":
                        ProjectNo = attrRef.TextString;
                        break;
                    case "SubProjectNo":
                        SubProjectNo = attrRef.TextString;
                        break;
                    case "SheetTitleChinese":
                        SheetTitleChinese = attrRef.TextString;
                        break;
                    case "SheetTitleEnglish":
                        SheetTitleEnglish = attrRef.TextString;
                        break;
                    case "DisciplineChinese":
                        DisciplineChinese = attrRef.TextString;
                        break;
                    case "DisciplineEnglish":
                        DisciplineEnglish = attrRef.TextString;
                        break;
                    case "StageChinese":
                        StageChinese = attrRef.TextString;
                        break;
                    case "StageEnglish":
                        StageEnglish = attrRef.TextString;
                        break;
                    case "SheetNo":
                        SheetNo = attrRef.TextString;
                        break;
                    case "Rev2":
                        Rev2 = attrRef.TextString;
                        break;

                    case "ApprovedBy":
                        ApprovedBy.Name = attrRef.TextString;
                        break;
                    case "ReviewedBy":
                        ReviewedBy.Name = attrRef.TextString;
                        break;
                    case "CheckedBy":
                        CheckedBy.Name = attrRef.TextString;
                        break;
                    case "PrincipalInCharge1":
                        PrincipalInCharge1.Name = attrRef.TextString;
                        break;
                    case "PrincipalInCharge2":
                        PrincipalInCharge2.Name = attrRef.TextString;
                        break;
                    case "DisciplineResponsible1":
                        DisciplineResponsible1.Name = attrRef.TextString;
                        break;
                    case "DisciplineResponsible2":
                        DisciplineResponsible2.Name = attrRef.TextString;
                        break;
                    case "DesignedBy1":
                        DesignedBy1.Name = attrRef.TextString;
                        break;
                    case "DesignedBy2":
                        DesignedBy2.Name = attrRef.TextString;
                        break;
                    case "DrawnBy":
                        DrawnBy.Name = attrRef.TextString;
                        break;

                    case "ApprovedByDate":
                        ApprovedBy.Date = attrRef.TextString;
                        break;
                    case "ReviewedByDate":
                        ReviewedBy.Date = attrRef.TextString;
                        break;
                    case "CheckedByDate":
                        CheckedBy.Date = attrRef.TextString;
                        break;
                    case "PrincipalInCharge1Date":
                        PrincipalInCharge1.Date = attrRef.TextString;
                        break;
                    case "PrincipalInCharge2Date":
                        PrincipalInCharge2.Date = attrRef.TextString;
                        break;
                    case "DisciplineResponsible1Date":
                        DisciplineResponsible1.Date = attrRef.TextString;
                        break;
                    case "DisciplineResponsible2Date":
                        DisciplineResponsible2.Date = attrRef.TextString;
                        break;
                    case "DesignedBy1Date":
                        DesignedBy1.Date = attrRef.TextString;
                        break;
                    case "DesignedBy2Date":
                        DesignedBy2.Date = attrRef.TextString;
                        break;
                    case "DrawnByDate":
                        DrawnBy.Date = attrRef.TextString;
                        break;


                    case "Architecture1":
                        Architecture1.Name = attrRef.TextString;
                        break;
                    case "Architecture2":
                        Architecture2.Name = attrRef.TextString;
                        break;
                    case "Architecture3":
                        Architecture3.Name = attrRef.TextString;
                        break;
                    case "Plumbing1":
                        Plumbing1.Name = attrRef.TextString;
                        break;
                    case "Plumbing2":
                        Plumbing2.Name = attrRef.TextString;
                        break;
                    case "Plumbing3":
                        Plumbing3.Name = attrRef.TextString;
                        break;
                    case "HVAC1":
                        HVAC1.Name = attrRef.TextString;
                        break;
                    case "HVAC2":
                        HVAC2.Name = attrRef.TextString;
                        break;
                    case "HVAC3":
                        HVAC3.Name = attrRef.TextString;
                        break;
                    case "Electricity1":
                        Electricity1.Name = attrRef.TextString;
                        break;
                    case "Electricity2":
                        Electricity2.Name = attrRef.TextString;
                        break;
                    case "Electricity3":
                        Electricity3.Name = attrRef.TextString;
                        break;
                    case "Structure1":
                        Structure1.Name = attrRef.TextString;
                        break;
                    case "Structure2":
                        Structure2.Name = attrRef.TextString;
                        break;
                    case "Structure3":
                        Structure3.Name = attrRef.TextString;
                        break;
                    case "Structure4":
                        Structure4.Name = attrRef.TextString;
                        break;
                    case "Structure5":
                        Structure5.Name = attrRef.TextString;
                        break;
                    case "Structure6":
                        Structure6.Name = attrRef.TextString;
                        break;
                    case "Structure7":
                        Structure7.Name = attrRef.TextString;
                        break;
                    case "Power1":
                        Power1.Name = attrRef.TextString;
                        break;
                    case "Power2":
                        Power2.Name = attrRef.TextString;
                        break;
                    case "Power3":
                        Power3.Name = attrRef.TextString;
                        break;
                    case "ELV1":
                        ELV1.Name = attrRef.TextString;
                        break;
                    case "ELV2":
                        ELV2.Name = attrRef.TextString;
                        break;
                    case "ELV3":
                        ELV3.Name = attrRef.TextString;
                        break;
                }
            }
        }
    }
}
